  <?php get_header(); ?>
  

<script type="text/javascript" src="./mostraVolantiniHome.js" ></script>
<div id="scroller-container">
<div id="galleria"><h3><strong><i>Offerte in Evidenza a: <span id="citta"></span></i></strong></h3>    <div id="social"><div id="facebook"><iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2FVolantinopoli%3Ffref%3Dts&amp;send=false&amp;layout=button_count&amp;width=450&amp;show_faces=true&amp;font&amp;colorscheme=light&amp;action=like&amp;height=80&amp;appId=342642402476340" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:240px; height:26px;" allowTransparency="true"></iframe></div><div id="twitter"><a href="https://twitter.com/Volantinopoli" class="twitter-follow-button" data-show-count="false" data-lang="it">Segui @Volantinopoli</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script></div><div class="clear"></div></div><div class="clear"></div></div>
    <div id="scroller">
	<script src="http://maps.google.com/maps/api/js?sensor=true"><!--mce:0--></script>
	<script type="text/javascript">
	if (navigator.geolocation !== 'undefined') {
			navigator.geolocation.getCurrentPosition(displayLocation);   
		} else {
 			 alert('Il tuo browser non supporta geolocalizzazione.');
		}
		function displayLocation (position) {
  		lat = position.coords.latitude;
  		lon = position.coords.longitude;
		
		getCity();
	};
	function getCity() {
 		var point = new google.maps.LatLng(lat, lon);
  		//crea un nuovo oggetto Geocoder
  		var geocoder = new google.maps.Geocoder();
  		geocoder.geocode({'latLng': point}, function(results, status) {
		if (status == google.maps.GeocoderStatus.OK) {
			if (results[1]) {
				//mettiamo l'indirizzo ricevuto in un div yourCITYdiv
				citta = results[1].formatted_address;
				var c = citta.split(",");
				y=c[0].length;
				var x="";
				for(i = 0; i<y-2; i++)
					x = x + c[0][i];
				document.getElementById("citta").innerHTML=x;
				document.title="Volantinopoli - Offerte in " + x;
				if(window.XMLHttpRequest)
				{
					xmlhttp=new XMLHttpRequest();
				}
				xmlhttp.open("GET", "getVolantini.php?citta="+x, true);
				xmlhttp.onreadystatechange=funzione;
				xmlhttp.send("");
			}
		}
  		});
	}
	function funzione() {
	if(xmlhttp.readyState==4 && xmlhttp.status==200){
		document.getElementById("scroller").innerHTML=xmlhttp.responseText;
		
	}
}
	</script>
    <ul>
    
<li>

    <?php $custom_query = new WP_Query('posts_per_page=4&offset=4'); 
while($custom_query->have_posts()) : $custom_query->the_post(); ?>


      <div class="scroll-film">
                            

                            <div class="scroll-thumb"><a href="<?php the_permalink(); ?>"><img src="<?php echo catch_that_image() ?>"></a></div>
                            
                            <div class="scroll-film-toolbar clearfix">
                                
                                

 
                            </div>

                        </div>


<?php endwhile; ?>
<?php wp_reset_postdata(); ?>
</li>

<li>
    <?php $custom_query = new WP_Query('posts_per_page=4&offset=8'); 
while($custom_query->have_posts()) : $custom_query->the_post(); ?>


      <div class="scroll-film">
                            

                            <div class="scroll-thumb"><a href="<?php the_permalink(); ?>"><img src="<?php echo catch_that_image() ?>"></a></div>
                            
                            <div class="scroll-film-toolbar clearfix">
                                
                                

 
                            </div>

                        </div>


<?php endwhile; ?>
<?php wp_reset_postdata(); ?>


</li>
</ul>

      
    </div>
</div>



<div id="content">

<div id="tabs_wrapper">
	<div id="tabs_container">
		<ul id="tabs">
			<li class="active"><a name="3" href="#tab1" onclick="mostraVolantino(this)">Alimentari</a></li>
            <li><a class="icon_accept" name="4" href="#tab2" onclick="mostraVolantino(this)">Abbigliamento</a></li>
			<li><a class="icon_accept" name="1" href="#tab3" onclick="mostraVolantino(this)">Arredamento</a></li>
			<li><a name="6" href="#tab4" onclick="mostraVolantino(this)">Elettronica</a></li>
            <li><a name="7" href="#tab5" onclick="mostraVolantino(this)">Salute & Benessere</a></li>
            <li><a name="16" href="#tab6" onclick="mostraVolantino(this)">Bricolage</a></li>
            <li><a name="17" href="#tab7" onclick="mostraVolantino(this)">Viaggi</a></li>
            <li><a name="18" href="#tab8" onclick="mostraVolantino(this)">Immobili</a></li>
            <li><a name="19" href="#tab9" onclick="mostraVolantino(this)">Ufficio</a></li>
            <li><a name="20" href="#tab10" onclick="mostraVolantino(this)">Infanzia</a></li>
            <li><a name="24" href="#tab11" onclick="mostraVolantino(this)">2 & 4 Ruote</a></li>
		</ul>
	</div>
	<div id="tabs_content_container">
	</div>
</div>

  
 
  <div class="clear"></div>
  
  </div>  


  

<?php get_footer(); ?>